package com.tsj.spzx.mapper;

import com.tsj.spzx.model.entity.product.Category;
import com.tsj.spzx.model.vo.product.CategoryExcelVo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CategoryMapper {

    /**
     * 根据parentId查询子节点
     * @param parentId
     * @return
     */
    List<Category> findByParentId(Long parentId);

    /**
     * 查询子节点的数量
     * @param categoryIdList
     * @return
     */
    List<Long> findCountByParentId(List<Long> categoryIdList);

    /**
     * 查询所有分类数据
     * @return
     */
    List<Category> findAll();

    /**
     * 见数据存入数据库
     * @param cachedDataList
     */
    void saveBatch(List<CategoryExcelVo> cachedDataList);
}
